package 代理设计模式;

public class WXProxy  implements WXService{
    private WXService service;
    public WXProxy(WXService service){
        this.service = service;
    }
    @Override
    public void sendMsg(String msg) {
        System.out.println("代理之前操作");
        service.sendMsg(msg);
        System.out.println("代理之后操作");
    }

    public static void main(String[] args) {
        WXProxy proxy = new WXProxy(new WXServiceImpl());
        proxy.sendMsg("hello");
    }
}
